import Vue from 'vue'
import App from '@/App'
import router from '@/router'
import store from '@/store'
import VueCookie from 'vue-cookie'
import '@/element-ui'
import '@/icons'
import '@/element-ui-theme'
import '@/assets/scss/index.scss'
import httpRequest from '@/utils/httpRequest'
import { isAuth, getLoading, getDynamicHeight, unbindResize } from '@/utils'
import cloneDeep from 'lodash/cloneDeep'
import * as filter from './filter' //全局过滤器
import ElTreeSelect from 'el-tree-select';

import VueVideoPlayer from './components/video-player'

import 'video.js/dist/video-js.css'
import './components/video-player/custom-theme.css'
import utils from '@/utils/utils'

Vue.use(ElTreeSelect);

Vue.use(VueVideoPlayer)

// 注册全局过滤器
Object.keys(filter).forEach(key => {
  Vue.filter(key, filter[key])
})

Vue.use(VueCookie)
Vue.config.productionTip = false

// 挂载全局
Vue.prototype.$load = getLoading
Vue.prototype.$http = httpRequest // ajax请求方法
Vue.prototype.isAuth = isAuth     // 权限方法
Vue.prototype.$dynamic = getDynamicHeight // 获取动态高度（resize）
Vue.prototype.$unResize = unbindResize // 解除重置大小监听
Vue.prototype.$cloneDeep = cloneDeep // 深拷贝
Vue.prototype.$utils = utils;

// 保存整站vuex本地储存初始状态
window.SITE_CONFIG['storeState'] = cloneDeep(store.state)

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: { App }
})
